﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PageNavControl.ascx.cs"
    Inherits="Warehouse.Web.UserControls.PageNavControl" EnableViewState="false" %>
<p class="allpage">
    <asp:HiddenField ID="tbUrl" runat="server" />
    <asp:HyperLink ID="lnkPrePage" runat="server">上一页</asp:HyperLink>
    <asp:Literal ID="ltPages" runat="server"></asp:Literal>
    <asp:HyperLink ID="lnkNextPage" runat="server">下一页</asp:HyperLink>
    <span>跳转到<input type="text" id="PageNav_tbPage" style="width: 36px; text-align: center;
        margin: 0 2px;" />页</span> <span>共<asp:Label ID="lbPageCount" runat="server"></asp:Label>页</span>

    <script type="text/javascript">
        document.getElementById('PageNav_tbPage').onkeydown = function(e) {
            e = e || window.event;
            if (e.keyCode == 13) {
                var p = decodeURI(document.getElementById('PageNav_tbPage').value);
                if (!p || isNaN(p)) {
                    alert("请输入数字");
                    document.getElementById('PageNav_tbPage').value = "";
                } else {
                    window.location.href = document.getElementById('<%= this.tbUrl.ClientID %>').value + p;
                }
                return false;
            }
        };
    </script>

</p>